package com.cntcdt.api.service.impl;

import java.util.List;

import com.cntcdt.api.db.dao.GroupUserDao;
import com.cntcdt.api.db.model.GroupUserModel;
import com.cntcdt.api.service.GroupUserService;

public class GroupUserServiceImpl implements GroupUserService {

	@Override
	public GroupUserModel findByUsernameAndPassword(String username,
			String password) {
		return GroupUserDao.getInstance().findByUsernameAndPassword(username, password);
	}

	@Override
	public GroupUserModel findById(int id) {
		return GroupUserDao.getInstance().findByPrimaryKey(id);
	}

	@Override
	public List<GroupUserModel> findByGroupId(int id) {
		return GroupUserDao.getInstance().findByGroupId(id);
	}

	@Override
	public GroupUserModel findByUsername(String username) {
		return GroupUserDao.getInstance().findByUsername(username);
	}

	@Override
	public int insertModel(GroupUserModel groupUser) {
		return GroupUserDao.getInstance().insert(groupUser);
	}

	@Override
	public boolean updateModel(GroupUserModel groupUser) {
		return GroupUserDao.getInstance().updateAny(groupUser);
	}

	@Override
	public List<GroupUserModel> findBySortTime(long sortTime) {
		return GroupUserDao.getInstance().findBySortTime(sortTime);
	}

	@Override
	public List<GroupUserModel> findByGroupId(int id, long sortTime) {
		return GroupUserDao.getInstance().findByGroupId(id,sortTime);
	}

	@Override
	public List<GroupUserModel> findBySearchContent(String searchContent,long sortTime) {
		return GroupUserDao.getInstance().findBySearchContent(searchContent, sortTime);
	}

	@Override
	public List<GroupUserModel> findByLargerThanLevel(int level,long sortTime) {
		return GroupUserDao.getInstance().findByLargerThanLevel(level,sortTime);
	}

}
